package com.ruipengkj.view.workShiftView;

import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.JTabbedPane;

import com.ruipengkj.bean.TWorkShift;
import com.ruipengkj.component.tabbedPane.PerTabbedPaneUI;
import com.ruipengkj.component.tabbedPane.RPTabHeadComponent;
import com.ruipengkj.view.base.BasePagePanel;

public class AllWorkShiftPanel extends BasePagePanel<TWorkShift> implements Runnable{
	private static final long serialVersionUID = 1L;
	WorkShiftPanel workShiftPanel;
	WorkShiftTakeNotesPanel workShiftTakeNotesPanel;
    public AllWorkShiftPanel() {
    	JTabbedPane tabPane = new JTabbedPane();
		// 设置面板布局为网格布局
		this.setLayout(new GridLayout(1,1));
		tabPane.setTabPlacement(JTabbedPane.TOP);// 设定选项卡放在上部
		this.add(tabPane);// 将选项窗格放置在面板中
		workShiftPanel = new WorkShiftPanel();
		workShiftTakeNotesPanel = new WorkShiftTakeNotesPanel();
		tabPane.addTab("交班", null,workShiftPanel, "交班");
		tabPane.addTab("交班记录", null, workShiftTakeNotesPanel, "交班记录");

		tabPane.setUI(new PerTabbedPaneUI(tabPane, 40));
		tabPane.setTabComponentAt(0, new RPTabHeadComponent(tabPane, "交  班"));
		tabPane.setTabComponentAt(1, new RPTabHeadComponent(tabPane, "交班记录"));
		tabPane.setBorder(BorderFactory.createTitledBorder(""));
		// 选择第一个选项页为当前选择的选项页
		tabPane.setSelectedIndex(0);
		
    }

	@Override
	public void run() {
		workShiftPanel.run();
		workShiftTakeNotesPanel.run();
	}

	@Override
	public void clear() {
		// TODO Auto-generated method stub
		
	}
}
